<?php
/*
 * 请求方法设置
 * 不区分大小写
 */
function methodsRequired(array $methods) {
    foreach ($methods as $method) {
        if ($_SERVER["REQUEST_METHOD"]==strtoupper($method)){
            return true;
        }
    }
    http_response_code(405);
    echo "405,method not allowed!";
    return false;
}
